package com.hooya.fa.eu.biz.dao.mapper.eu.his;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hooya.fa.eu.api.bo.TempMmjlBO;
import com.hooya.fa.eu.biz.dao.entity.eu.his.TempMmjl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @Description 1
 * @Author : Zongz
 * @Copyright Copyright (c) 豪雅集团
 * @Create 2024/3/19
 * @Version 1.0.0
 */
@Mapper
public interface HisTempMmjlMapper extends BaseMapper<TempMmjl> {

    void insertBatchSomeColumn(List<TempMmjl> list);

    @Select("SELECT a.id, a.cpbh, a.place, a.sl, a.from_company, a.to_company, a.sheet_number, a.date, " +
            "i.invoiceNo, b.dian_pu, b.order_id " +
            "FROM `fa_eu_his`.`temp_mmjl` a\n" +
            "inner join temp_xsjl b on a.sheet_number = b.sheet_number\n" +
            "inner join fa_eu.inv_invoice i on i.Id = a.invoice_id " +
            "WHERE a.`date` >= #{startDate} AND a.`date` < #{endDate}")
    List<TempMmjlBO> getListByDate(@Param("startDate") String startDate, @Param("endDate") String endDate);
}
